﻿using AbpApplication.InPut;
using CommunityToolkit.Mvvm.Input;
using NewWms.Apiservice;
using Prism.Mvvm;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Reconstruct_Desktop.ViewModels.DialogsModel
{
   public partial class UpdateInlethouseLineDialogModel : BindableBase, IDialogAware
    {



        public UpdateInlethouseLineDialogModel() 
        {
            _baseService = new BaseService();
            InPut_BaseService = new InPut_BaseService18();

        }



        private readonly IBaseService _baseService;
        [RelayCommand]
        private async void UpdateState(string obj)
        {
            InPut_BaseService.IsEnable = bool.Parse(obj);
            await _baseService.UpdateState_ByInlethouselineId(InPut_BaseService);
            RequestClose?.Invoke(null);
        }






        public string InlethouselineId { get; set; }

        private InPut_BaseService18 inPut_BaseService;

        public InPut_BaseService18 InPut_BaseService
        {
            get { return inPut_BaseService; }
            set { inPut_BaseService = value; RaisePropertyChanged(); }
        }




        //基础
        public string Title { get; set; } = "设置";

        public event Action<IDialogResult> RequestClose;

        public bool CanCloseDialog()
        {
            return true;
        }

        public void OnDialogClosed()
        {

        }

        public void OnDialogOpened(IDialogParameters parameters)
        {
            if (parameters.Count > 0)
            {
                string pars = parameters.GetValue<object>("1").ToString(); // 根据你的数据类型替换 'int'
                InPut_BaseService.Id_InlethouseLine = Guid.Parse(pars);
            }
        }
    }
}
